﻿#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
#endregion

namespace SharedCongkak
{
    public class Seed
    {
        #region fields

        Color color;
        private static Texture2D seedTex;
        const int width = 45;
        const int height = 45;
        #endregion
        #region Initialization

        public Vector2 Position
        {
            set;
            get;
        }

        public Vector2 Center
        {
            get
            {
                return Position + new Vector2(width / 2.0f, height / 2.0f);
            }
            set
            {
                Position = value - new Vector2(width / 2.0f, height / 2.0f);
            }
        }

        public int Width
        {
            get { return width; }
        }

        public int Height
        {
            get { return height; }
        }

        public int Score
        {
            get;
            set;
        }

        public Seed()
        {
        }

        public Seed(Color color, Vector2 position, int score)
        {
            this.color = color;
            Position = position;
            this.Score = score;
        }

        public Seed(Color color, int score):this(color, Vector2.Zero,score)
        {
    
        }

        #endregion

        public void Update(GameTime gameTime)
        {

        }

        public static void LoadContent(ContentManager content)
        {
            
            seedTex = content.Load<Texture2D>("texture/marble");

        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(seedTex, Center, color);
        }

        public void Draw(SpriteBatch spriteBatch, Vector2 position)
        {
            position.X = position.X - width / 2;
            position.Y = position.Y - height / 2;
            spriteBatch.Draw(seedTex, Center + position, color);
        }
    }
}
